home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / strcls10.zip / STR.H < prev   
C/C++ Source or Header  |  1991-04-06  |  2KB  |  48 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  String Class for C++
  4. //  Copyright (C) 1991 by Jui-Lin Hung and SPD!
  5. //
  6. //  You may freely use or incorporate these routines into your own programs
  7. //  without royalty to me, as I believe this is beneficial to programmers.
  8. //  However, I would like to request that if you distribute the source code,
  9. //  Thank you, and I hope these routines are useful.
  10. //
  11. //  April, 1991 - Version 1.0
  12. //
  13. /////////////////////////////////////////////////////////////////////////////
  14.  
  15.  
  16. #ifndef __STR_H
  17. #define __STR_H
  18.  
  19. #ifndef __CRC16_H
  20.     #include "crc16.h"
  21. #endif
  22.  
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25.  
  26.  
  27. class Str {
  28. private:
  29. public:
  30.     // Member functions
  31.     char strBlank(char *);          // Returns 1 if string is blank
  32.     unsigned int strCrc16(char *);  // Returns the 16-bit CRC
  33.     unsigned int strCrc16(char *,unsigned int)  // Returns the 16-bit CRC
  34.     char *strCrypt(char *);         // Returns the XOR crypted string
  35.     char *strProper(char *);        // Returns The String Properly Capitalized
  36.     char *strTrimLeft(char *);      // Trims whitespace off left of string
  37.     char *strTrimRight(char *);     // Trips whitespace off right of string
  38.  
  39.     // Inline functions
  40.     char *strTrimBoth(char *str)    // Trims whitespace off right and left
  41.         {
  42.             return(strTrimLeft(strTrimRight(str)));
  43.         }
  44. };
  45.  
  46.  
  47. #endif // __STR_H
  48.